package com.hmall.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmall.item.pojo.Item;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ItemMapper extends BaseMapper<Item> {
    @Update("update tb_item set status=#{status} where id=#{id}")
    void updateStatus(@Param("id") Long id, @Param("status") Integer status);
    @Select("select * from tb_item order by sold desc limit 20")
    List<Item> getTop20();
}
